/**
 * This file is released under the GNU General Public License.
 * Refer to the COPYING file distributed with this package.
 *
 * Copyright (c) 2008-2009 WURFL-Pro srl
 */
package net.sourceforge.wurfl.core.handlers;

import net.sourceforge.wurfl.core.request.normalizer.UserAgentNormalizer;

import org.apache.commons.lang.StringUtils;

/**
 * Intercept all UAs starting with "Mot-" or containing "MOT-" or "Motorola".
 * 
 * @author WURFL-PRO SRL, Rome, Italy
 * @version $Id: MotorolaHandler.java 1045 2009-03-09 15:52:53Z filippo.deluca $
 */
public class MotorolaHandler extends Handler {

	public MotorolaHandler(UserAgentNormalizer normalizer) {
		super(normalizer);
	}

	/**
	 * Intercept all UAs starting with "Mot-", or containing "MOT-" or
	 * "Motorola".
	 */
	public boolean canHandle(String userAgent) {
		return (userAgent.startsWith("Mot-")
				|| StringUtils.contains(userAgent, "MOT-") || StringUtils
				.contains(userAgent, "Motorola"));
	}

}
